#pragma once
#include <iostream>
using namespace std;

template <class type, int dim>
class TPoint
{
public:
	TPoint(void);
	TPoint(type coords[dim])
	{
		for ( int index = 0; index < dim; index++ )
		{
			_coords[ index ] = coords[ index ];
		}
	}
	~TPoint(void);

	type& operator[] (int index)
	{
		assert( index < dim && index >= 0 );
		return _coords[ index ];
	}

	type operator() ( int index ) const
	{

	}

private:
	type _coords[ dim ];
};

template <class type, int dim >
ostream& operator<<( ostream &os, const TPoint< type, dim > &pt )
{
	os << "(";
	for ( int ix = 0; ix < dim-1; ix++ )
	{
		os << pt[ ix ] << ", ";
	}
	os << pt[ dim-1 ];
	os << ")";
}